<template>
  <el-dropdown v-bind="$attrs" v-on="$listeners" trigger="click">
    <slot></slot>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item v-for="(item,i) in menu" :key="i" @click.native="item.click">{{item.name}}</el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</template>

<script>
  export default {
    name: 'my-dropdown',
    props: {
      menu: {
        type: Array,
        default: ()=>{
          return []
        }
      }
    }
  }
</script>

<style scoped>

</style>
